<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
<!--      <el-form-item label="机构名称" prop="unitName">-->
<!--        <el-input-->
<!--          v-model="queryParams.unitName"-->
<!--          placeholder="请输入机构名称"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
      <el-form-item label="昵称" prop="nickName">
        <el-input
          v-model="queryParams.nickName"
          placeholder="请输入昵称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="姓名" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入姓名"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="联系方式" prop="phone">
        <el-input
          v-model="queryParams.phone"
          placeholder="请输入联系方式"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--      <el-form-item label="备用手机号1" prop="phone1">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.phone1"-->
      <!--          placeholder="请输入备用手机号1"-->
      <!--          clearable-->
      <!--          size="small"-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="备用手机号2" prop="phone2">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.phone2"-->
      <!--          placeholder="请输入备用手机号2"-->
      <!--          clearable-->
      <!--          size="small"-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->


      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <!--      <el-col :span="1.5">-->
      <!--        <el-button-->
      <!--          type="primary"-->
      <!--          plain-->
      <!--          icon="el-icon-plus"-->
      <!--          size="mini"-->
      <!--          @click="handleAdd"-->
      <!--          v-hasPermi="['business:member:add']"-->
      <!--        >新增</el-button>-->
      <!--      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['business:member:edit']"
        >修改
        </el-button>
      </el-col>
      <el-col :span="12">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['business:member:remove']"
        >删除
        </el-button>
      </el-col>
      <!--      <el-col :span="1.5">-->
      <!--        <el-button-->
      <!--          type="warning"-->
      <!--          plain-->
      <!--          icon="el-icon-download"-->
      <!--          size="mini"-->
      <!--          @click="handleExport"-->
      <!--          v-hasPermi="['business:member:export']"-->
      <!--        >导出</el-button>-->
      <!--      </el-col>-->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="memberList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <!--      <el-table-column label="学员ID" align="center" prop="memberId" />-->
      <!--      <el-table-column label="GUID" align="center" prop="guid" />-->
      <!--      <el-table-column label="用户组ID" align="center" prop="groupId" />-->
      <!--      <el-table-column label="机构代码" align="center" prop="unitId" />-->
      <!--      <el-table-column label="机构名称" align="center" prop="unitName" />-->
      <!--      <el-table-column label="最后选择的专业级别" align="center" prop="lastMajorId" />-->
      <!--      <el-table-column label="可用的专业id,多个逗号分隔" align="center" prop="availableMajorId" />-->
      <el-table-column label="昵称" align="center" prop="nickName"/>
      <el-table-column label="姓名" align="center" prop="name"/>
      <el-table-column label="账号" align="center" prop="accountName"/>
      <!--      <el-table-column label="密码" align="center" prop="password" />-->
      <el-table-column label="联系方式" align="center" prop="phone"/>
      <!--      <el-table-column label="备用手机号1" align="center" prop="phone1" />-->
      <!--      <el-table-column label="备用手机号2" align="center" prop="phone2" />-->
      <!--      <el-table-column label="个人简介" align="center" prop="briefIntroduction" />-->
      <!--      <el-table-column label="等级" align="center" prop="level" />-->
      <!--      <el-table-column label="用户性别" align="center" prop="sex" />-->
      <!--      <el-table-column label="生日" align="center" prop="birthday" width="180">-->
      <!--        <template slot-scope="scope">-->
      <!--          <span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>-->
      <!--        </template>-->
      <!--      </el-table-column>-->
      <el-table-column label="邮箱" align="center" prop="email"/>
      <!--      <el-table-column label="是否禁言" align="center" prop="isMute" />-->
      <el-table-column label="地址" align="center" prop="address"/>
      <el-table-column label="身份证" align="center" prop="idCard"/>
      <el-table-column label="头像地址" align="center" prop="avatar">
        <template slot-scope="scope">
          <image-preview :src="scope.row.avatar" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <!--      <el-table-column label="头像ID" align="center" prop="avatarId" />-->
      <!--      <el-table-column label="头像资源ID" align="center" prop="avatarResId" />-->
      <el-table-column label="是否是vip" align="center" prop="isVip">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.bu_is_no" :value="scope.row.isVip"/>
        </template>
      </el-table-column>
<!--      <el-table-column label="到期时间" align="center" prop="expiryTime" width="180">-->
<!--        <template slot-scope="scope">-->
<!--          <span>{{ parseTime(scope.row.expiryTime, '{y}-{m}-{d}') }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column label="会员类型" align="center" prop="vipType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.bu_vip_type" :value="scope.row.vipType"/>
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="status"/>
      <!--      <el-table-column label="最后登录IP" align="center" prop="loginIp" />-->
      <!--      <el-table-column label="最后登录时间" align="center" prop="loginDate" width="180">-->
      <!--        <template slot-scope="scope">-->
      <!--          <span>{{ parseTime(scope.row.loginDate, '{y}-{m}-{d}') }}</span>-->
      <!--        </template>-->
      <!--      </el-table-column>-->
      <!--      <el-table-column label="登录次数" align="center" prop="loginNum" />-->
      <!--      <el-table-column label="观看视频次数" align="center" prop="videoNum" />-->
      <!--      <el-table-column label="观看视频时长" align="center" prop="videoDuration" />-->
      <!--      <el-table-column label="顺序" align="center" prop="sort" />-->
      <!--      <el-table-column label="会员点赞的试题ID" align="center" prop="starQuesIds" />-->
      <!--      <el-table-column label="会员踩的试题ID" align="center" prop="stepQuesIds" />-->
      <!--      <el-table-column label="备注" align="center" prop="remark" />-->
      <el-table-column label="积分" align="center" prop="integral"/>
      <el-table-column label="签到次数" align="center" prop="signNum"/>
      <!--      <el-table-column label="省份" align="center" prop="province" />-->
      <el-table-column label="城市" align="center" prop="city"/>
      <!--      <el-table-column label="签名" align="center" prop="intro" />-->
      <!--      <el-table-column label="专业资质" align="center" prop="proQualifications" />-->
      <!--      <el-table-column label="补充说明" align="center" prop="expertiseNotes" />-->
      <!--      <el-table-column label="擅长领域人群" align="center" prop="expertiseDemographics" />-->
      <!--      <el-table-column label="擅长领域" align="center" prop="expertiseTopics" />-->
      <!--      <el-table-column label="擅长领域" align="center" prop="expertiseGenres" />-->
      <!--      <el-table-column label="教育背景" align="center" prop="education" />-->
      <!--      <el-table-column label="职业照" align="center" prop="profilePhotoUrl" />-->
      <!--      <el-table-column label="资质证书" align="center" prop="certificateUrl" />-->
      <!--      <el-table-column label="受训经历" align="center" prop="trainingExperience" />-->
      <!--      <el-table-column label="受训时长" align="center" prop="trainingDuration" />-->
      <!--      <el-table-column label="个案时长/咨询时长" align="center" prop="caseDuration" />-->
      <!--      <el-table-column label="个案/咨询文件" align="center" prop="caseFiles" />-->
      <!--      <el-table-column label="督导时长" align="center" prop="supervisionDuration" />-->
      <!--      <el-table-column label="督导文件" align="center" prop="supervisionFiles" />-->
      <!--      <el-table-column label="从业年限" align="center" prop="yearsOfExperience" />-->
      <!--      <el-table-column label="部门(机构)Id" align="center" prop="deptId" />-->
      <!--      <el-table-column label="App端微信openid" align="center" prop="openid" />-->
      <!--      <el-table-column label="小程序端微信openid" align="center" prop="openId" />-->
      <!--      <el-table-column label="各端微信登录统一用户标识" align="center" prop="unionId" />-->
      <!--      <el-table-column label="极光推送用户标识" align="center" prop="registrationId" />-->
      <el-table-column label="咨询师主页设置的价格" align="center" prop="price"/>
      <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['business:member:edit']"
          >修改
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="checkhandleUpdate(scope.row)"
          >审核信息
          </el-button>


          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['business:member:remove']"
          >删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改咨询师对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="150px">
        <!--        <el-form-item label="GUID" prop="guid">-->
        <!--          <el-input v-model="form.guid" placeholder="请输入GUID" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="用户组ID" prop="groupId">-->
        <!--          <el-input v-model="form.groupId" placeholder="请输入用户组ID" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="机构代码" prop="unitId">-->
        <!--          <el-input v-model="form.unitId" placeholder="请输入机构代码" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="机构名称" prop="unitName">-->
        <!--          <el-input v-model="form.unitName" placeholder="请输入机构名称" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="最后选择的专业级别" prop="lastMajorId">-->
        <!--          <el-input v-model="form.lastMajorId" placeholder="请输入最后选择的专业级别" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="可用的专业id,多个逗号分隔" prop="availableMajorId">-->
        <!--          <el-input v-model="form.availableMajorId" placeholder="请输入可用的专业id,多个逗号分隔" />-->
        <!--        </el-form-item>-->
        <el-row class="mb8">
          <el-col :span="12">
            <el-form-item label="昵称" prop="nickName">
              <el-input v-model="form.nickName" placeholder="请输入昵称"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="姓名" prop="name">
              <el-input v-model="form.name" placeholder="请输入姓名"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row class="mb8">
          <el-col :span="12">
            <el-form-item label="账号" prop="accountName">
              <el-input v-model="form.accountName" placeholder="请输入账号"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="联系方式" prop="phone">
              <el-input v-model="form.phone" placeholder="请输入联系方式"/>
            </el-form-item>

          </el-col>
        </el-row>

        <el-row class="mb8">
          <el-col :span="12">
            <el-form-item label="备用手机号1" prop="phone1">
              <el-input v-model="form.phone1" placeholder="请输入备用手机号1"/>
            </el-form-item>

          </el-col>
          <el-col :span="12">
            <el-form-item label="备用手机号2" prop="phone2">
              <el-input v-model="form.phone2" placeholder="请输入备用手机号2"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row class="mb8">
          <el-col :span="12">
            <el-form-item label="身份" prop="consultantTitle">
              <el-input v-model="form.consultantTitle" placeholder="请输入身份"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="入驻时间" prop="consultantTime">
              <el-date-picker clearable size="small"
                              v-model="form.consultantTime"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="选择入驻时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>






        <el-row class="mb8">
          <el-col :span="12">
            <el-form-item label="等级" prop="level">
              <el-input v-model="form.level" placeholder="请输入等级"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="生日" prop="birthday">
              <el-date-picker clearable size="small"
                              v-model="form.birthday"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="选择生日">
              </el-date-picker>
            </el-form-item>

          </el-col>
        </el-row>
        <el-row class="mb8">
          <el-col :span="12">
            <el-form-item label="邮箱" prop="email">
              <el-input v-model="form.email" placeholder="请输入邮箱"/>
            </el-form-item>

          </el-col>
          <el-col :span="12">
            <el-form-item label="地址" prop="address">
              <el-input v-model="form.address" placeholder="请输入地址"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row class="mb8">
          <el-col :span="12">

            <el-form-item label="身份证" prop="idCard">
              <el-input v-model="form.idCard" placeholder="请输入身份证"/>
            </el-form-item>

          </el-col>
          <el-col :span="12">

          </el-col>
        </el-row>
        <el-form-item label="头像" prop="avatar">
          <image-upload v-model="form.avatar" :limit="1"/>
        </el-form-item>
        <el-form-item label="个人简介" prop="briefIntroduction">
          <el-input v-model="form.briefIntroduction" type="textarea" placeholder="请输入个人简介"/>
        </el-form-item>
        <el-row class="mb8">
          <el-col :span="12">
            <el-form-item label="是否是vip" prop="isVip">
              <el-select v-model="form.isVip" placeholder="请选择">
                <el-option v-for="dict in dict.type.bu_is_no" :key="dict.value" :label="dict.label"
                           :value="dict.value"/>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="会员类型" prop="vipType">
              <el-select v-model="form.vipType" placeholder="请选择">
                <el-option v-for="dict in dict.type.bu_vip_type" :key="dict.value" :label="dict.label"
                           :value="dict.value"/>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row class="mb8">
          <el-col :span="12">
            <el-form-item label="省份" prop="province">
              <el-input v-model="form.province" placeholder="请输入省份"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="城市" prop="city">
              <el-input v-model="form.city" placeholder="请输入城市"/>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="12">
            <el-form-item label="签名" prop="intro">
              <el-input v-model="form.intro" type="textarea" placeholder="请输入签名"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="专业资质" prop="proQualifications">
              <el-input v-model="form.proQualifications" type="textarea" placeholder="请输入专业资质"/>
            </el-form-item>

          </el-col>
        </el-row>


        <el-row>
          <el-col :span="12">
            <el-form-item label="补充说明" prop="expertiseNotes">
              <el-input v-model="form.expertiseNotes" type="textarea" placeholder="请输入补充说明"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="擅长领域" prop="expertiseDemographics">
              <el-input v-model="form.expertiseDemographics" type="textarea" placeholder="请输入擅长领域"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="擅长群体" prop="expertiseTopics">
              <el-input v-model="form.expertiseTopics" placeholder="请输入擅长群体"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="擅长流派" prop="expertiseGenres">
              <el-input v-model="form.expertiseGenres" placeholder="请输入擅长流派域"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="教育背景" prop="education">
              <el-input v-model="form.education" placeholder="请输入教育背景"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">

          </el-col>
        </el-row>
        <el-form-item label="职业照" prop="profilePhotoUrl">
          <image-upload v-model="form.profilePhotoUrl"/>
        </el-form-item>
        <el-row>
          <el-col :span="12">

          </el-col>
          <el-col :span="12">

          </el-col>
        </el-row>
        <el-row class="mb8">
          <el-col :span="12">

          </el-col>
          <el-col :span="12">

          </el-col>
        </el-row>


        <!--        <el-form-item label="是否禁言" prop="isMute">-->
        <!--          <el-input v-model="form.isMute" placeholder="请输入是否禁言" />-->
        <!--        </el-form-item>-->


        <!--        <el-form-item label="头像ID" prop="avatarId">-->
        <!--          <el-input v-model="form.avatarId" placeholder="请输入头像ID" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="头像资源ID" prop="avatarResId">-->
        <!--          <el-input v-model="form.avatarResId" placeholder="请输入头像资源ID" />-->
        <!--        </el-form-item>-->

        <!--        <el-form-item label="到期时间" prop="expiryTime">-->
        <!--          <el-date-picker clearable size="small"-->
        <!--            v-model="form.expiryTime"-->
        <!--            type="date"-->
        <!--            value-format="yyyy-MM-dd"-->
        <!--            placeholder="选择到期时间">-->
        <!--          </el-date-picker>-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="最后登录IP" prop="loginIp">-->
        <!--          <el-input v-model="form.loginIp" placeholder="请输入最后登录IP" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="最后登录时间" prop="loginDate">-->
        <!--          <el-date-picker clearable size="small"-->
        <!--            v-model="form.loginDate"-->
        <!--            type="date"-->
        <!--            value-format="yyyy-MM-dd"-->
        <!--            placeholder="选择最后登录时间">-->
        <!--          </el-date-picker>-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="登录次数" prop="loginNum">-->
        <!--          <el-input v-model="form.loginNum" placeholder="请输入登录次数" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="观看视频次数" prop="videoNum">-->
        <!--          <el-input v-model="form.videoNum" placeholder="请输入观看视频次数" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="观看视频时长" prop="videoDuration">-->
        <!--          <el-input v-model="form.videoDuration" placeholder="请输入观看视频时长" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="顺序" prop="sort">-->
        <!--          <el-input v-model="form.sort" placeholder="请输入顺序" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="会员点赞的试题ID" prop="starQuesIds">-->
        <!--          <el-input v-model="form.starQuesIds" type="textarea" placeholder="请输入内容" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="会员踩的试题ID" prop="stepQuesIds">-->
        <!--          <el-input v-model="form.stepQuesIds" type="textarea" placeholder="请输入内容" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="备注" prop="remark">-->
        <!--          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="积分" prop="integral">-->
        <!--          <el-input v-model="form.integral" placeholder="请输入积分" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="签到次数" prop="signNum">-->
        <!--          <el-input v-model="form.signNum" placeholder="请输入签到次数" />-->
        <!--        </el-form-item>-->


        <!--        <el-form-item label="资质证书" prop="certificateUrl">-->
        <!--          <el-input v-model="form.certificateUrl" type="textarea" placeholder="请输入内容" />-->
        <!--        </el-form-item>-->
        <el-form-item label="受训经历" prop="trainingExperience">
          <el-input v-model="form.trainingExperience" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="受训时长" prop="trainingDuration">
          <el-input-number v-model="form.trainingDuration" placeholder="请输入受训时长"/>
        </el-form-item>
        <el-form-item label="个案时长/咨询时长" prop="caseDuration">
          <el-input-number v-model="form.caseDuration" placeholder="请输入个案时长/咨询时长"/>
        </el-form-item>
        <el-form-item label="个案/咨询文件" prop="caseFiles">
          <el-input v-model="form.caseFiles" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="督导时长" prop="supervisionDuration">
          <el-input-number v-model="form.supervisionDuration" placeholder="请输入督导时长"/>
        </el-form-item>
        <el-form-item label="督导文件" prop="supervisionFiles">
          <el-input v-model="form.supervisionFiles" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="从业年限" prop="yearsOfExperience">
          <el-input v-model="form.yearsOfExperience" placeholder="请输入从业年限"/>
        </el-form-item>
        <!--        <el-form-item label="部门(机构)Id" prop="deptId">-->
        <!--          <el-input v-model="form.deptId" placeholder="请输入部门(机构)Id" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="App端微信openid" prop="openid">-->
        <!--          <el-input v-model="form.openid" placeholder="请输入App端微信openid" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="小程序端微信openid" prop="openId">-->
        <!--          <el-input v-model="form.openId" placeholder="请输入小程序端微信openid" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="各端微信登录统一用户标识" prop="unionId">-->
        <!--          <el-input v-model="form.unionId" placeholder="请输入各端微信登录统一用户标识" />-->
        <!--        </el-form-item>-->
        <!--        <el-form-item label="极光推送用户标识" prop="registrationId">-->
        <!--          <el-input v-model="form.registrationId" placeholder="请输入极光推送用户标识" />-->
        <!--        </el-form-item>-->
        <el-form-item label="价格" prop="price">
          <el-input-number v-model="form.price" placeholder="请输入价格"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog :title="title" :visible.sync="checkopen" width="1200px" append-to-body>

      <div v-for="(item,index) in checkList">
        <el-form ref="form1" label-width="120px">
          <el-form-item label="内容类型" prop="contentType" disabled>
            <el-select v-model="item.contentType" disabled placeholder="请选择内容类型">
              <el-option
                v-for="dict in dict.type.check_content_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>

          <el-form-item label="职业照片或视频" prop="professionalPhoto1" v-if="item.contentType =='1'">
            <image-upload v-model="item.professionalPhoto1" disabled/>
          </el-form-item>
          <el-form-item label="证件类型" prop="documentType2" v-if="item.contentType =='2' ">
            <el-input v-model="item.documentType2" placeholder="请输入证件类型"/>
          </el-form-item>
          <el-form-item label="真实姓名" prop="realName2" v-if="item.contentType =='2'">
            <el-input v-model="item.realName2" placeholder="请输入真实姓名"/>
          </el-form-item>
          <el-form-item label="证件号码" prop="documentNumber2" v-if="item.contentType =='2'">
            <el-input v-model="item.documentNumber2" placeholder="请输入证件号码"/>
          </el-form-item>
          <el-form-item label="证件照片" prop="documentPhotos2" v-if="item.contentType =='2'">
            <image-upload v-model="item.documentPhotos2"/>
          </el-form-item>
          <el-form-item label="证书名称" prop="certificateName3" v-if="item.contentType =='3'">
            <el-input v-model="form.certificateName3" placeholder="请输入证书名称"/>
          </el-form-item>
          <el-form-item label="证书编号" prop="certificateNumber3" v-if="item.contentType =='3'">
            <el-input v-model="item.certificateNumber3" placeholder="请输入证书编号"/>
          </el-form-item>
          <el-form-item label="证书发证日期" prop="certificateIssuanceDate3" v-if="item.contentType =='3'">
            <el-date-picker clearable size="small"
                            v-model="item.certificateIssuanceDate3"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="选择证书发证日期">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="证书照片" prop="certificatePhotos3" v-if="item.contentType =='3'">
            <image-upload v-model="item.certificatePhotos3"/>
          </el-form-item>
          <el-form-item label="擅长领域" prop="expertiseField4" v-if="item.contentType =='4'">
            <el-input v-model="item.expertiseField4" placeholder="请输入擅长领域"/>
          </el-form-item>
          <el-form-item label="擅长群体" prop="expertiseGroup5" v-if="item.contentType =='5'">
            <el-input v-model="item.expertiseGroup5" placeholder="请输入擅长群体"/>
          </el-form-item>
          <el-form-item label="流派取向" prop="orientation6" v-if="item.contentType =='6'">
            <el-input v-model="item.orientation6" placeholder="请输入流派取向"/>
          </el-form-item>
          <el-form-item label="发证单位" prop="trainingOrganization7" v-if="item.contentType =='7'">
            <el-input v-model="item.trainingOrganization7" placeholder="请输入发证单位"/>
          </el-form-item>
          <el-form-item label="培训项目" prop="trainingProject7" v-if="item.contentType =='7'">
            <el-input v-model="item.trainingProject7" placeholder="请输入培训项目"/>
          </el-form-item>
          <el-form-item label="培训时长" prop="trainingDuration7" v-if="item.contentType =='7'">
            <el-input v-model="item.trainingDuration7" placeholder="请输入培训时长"/>
          </el-form-item>
          <el-form-item label="证书名称" prop="trainingCertificateName7" v-if="item.contentType =='7'">
            <el-input v-model="item.trainingCertificateName7" placeholder="请输入证书名称"/>
          </el-form-item>
          <el-form-item label="证件号码" prop="trainingCertificateNumber7" v-if="item.contentType =='7'">
            <el-input v-model="item.trainingCertificateNumber7" placeholder="请输入证件号码"/>
          </el-form-item>
          <el-form-item label="颁证时间" prop="trainingCertificationDate7" v-if="item.contentType =='7'">
            <el-date-picker clearable size="small"
                            v-model="item.trainingCertificationDate7"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="选择颁证时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="培训证书照片" prop="trainingPhotos7" v-if="item.contentType =='7'">
            <image-upload v-model="item.trainingPhotos7"/>
          </el-form-item>
          <el-form-item label="证明单位" prop="consultationOrganization8" v-if="item.contentType =='8'">
            <el-input v-model="item.consultationOrganization8" placeholder="请输入证明单位"/>
          </el-form-item>
          <el-form-item label="咨询项目" prop="consultationProject8" v-if="item.contentType =='8'">
            <el-input v-model="item.consultationProject8" placeholder="请输入咨询项目"/>
          </el-form-item>
          <el-form-item label="咨询开始时间" prop="consultationStartDate8" v-if="item.contentType =='8'">
            <el-date-picker clearable size="small"
                            v-model="item.consultationStartDate8"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="选择咨询时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="咨询结束时间" prop="consultationEndDate8" v-if="item.contentType =='8'">
            <el-date-picker clearable size="small"
                            v-model="item.consultationEndDate8"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="选择咨询时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="咨询时长" prop="consultationDuration8" v-if="item.contentType =='8'">
            <el-input v-model="item.consultationDuration8" placeholder="请输入咨询时长"/>
          </el-form-item>
          <el-form-item label="上传的咨询相关图片URL字符串" prop="consultationPhotos8" v-if="item.contentType =='8'">
            <el-input v-model="item.consultationPhotos8" type="textarea" placeholder="请输入内容"/>
          </el-form-item>
          <el-form-item label="证明单位" prop="supervisionOrganization9" v-if="item.contentType =='9'">
            <el-input v-model="item.supervisionOrganization9" placeholder="请输入证明单位"/>
          </el-form-item>
          <el-form-item label="督导姓名" prop="supervisorName9" v-if="item.contentType =='9'">
            <el-input v-model="item.supervisorName9" placeholder="请输入督导姓名"/>
          </el-form-item>
          <el-form-item label="督导时间" prop="supervisionStartDate9" v-if="item.contentType =='9'">
            <el-date-picker clearable size="small"
                            v-model="item.supervisionStartDate9"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="选择督导时间">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="督导时长" prop="supervisionDuration9" v-if="item.contentType =='9'">
            <el-input v-model="item.supervisionDuration9" placeholder="请输入督导时长"/>
          </el-form-item>
          <el-form-item label="上传的督导相关图片URL字符串" prop="supervisionPhotos9" v-if="item.contentType =='9'">
            <image-upload v-model="item.supervisionPhotos9"/>
          </el-form-item>
          <el-form-item label="审核状态">
            <el-radio-group v-model="item.status" >
              <el-radio
                v-for="dict in dict.type.zxs_check_status"
                :key="dict.value"
                :label="parseInt(dict.value)"
              >{{ dict.label }}
              </el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="审核拒绝原因" prop="auditReason">
            <el-input v-model="item.auditReason" type="textarea" placeholder="请输入审核拒绝原因"/>
          </el-form-item>
          <el-divider content-position="left"></el-divider>
        </el-form>

      </div>

      <div slot="footer" class="dialog-footer">
        <el-button @click="cancelcheckshow">取 消</el-button>
      </div>

    </el-dialog>
  </div>
</template>

<script>
import {listMember, getMember, delMember, addMember, updateMember} from "@/api/business/member";
import {alllistApplication} from "@/api/business/application";

export default {
  name: "Member",
  dicts: ['bu_is_no', 'bu_vip_type', 'check_content_type', 'zxs_check_status'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 咨询师表格数据
      memberList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        guid: null,
        groupId: null,
        unitId: null,
        unitName: null,
        lastMajorId: null,
        availableMajorId: null,
        nickName: null,
        name: null,
        accountName: null,
        password: null,
        phone: null,
        phone1: null,
        phone2: null,
        briefIntroduction: null,
        level: null,
        sex: null,
        birthday: null,
        email: null,
        isMute: null,
        address: null,
        idCard: null,
        avatar: null,
        avatarId: null,
        avatarResId: null,
        isVip: null,
        expiryTime: null,
        vipType: null,
        status: null,
        loginIp: null,
        loginDate: null,
        loginNum: null,
        videoNum: null,
        videoDuration: null,
        sort: null,
        starQuesIds: null,
        stepQuesIds: null,
        integral: null,
        signNum: null,
        province: null,
        city: null,
        intro: null,
        proQualifications: null,
        expertiseNotes: null,
        expertiseDemographics: null,
        expertiseTopics: null,
        expertiseGenres: null,
        education: null,
        profilePhotoUrl: null,
        certificateUrl: null,
        trainingExperience: null,
        trainingDuration: null,
        caseDuration: null,
        caseFiles: null,
        supervisionDuration: null,
        supervisionFiles: null,
        yearsOfExperience: null,
        deptId: null,
        openid: null,
        openId: null,
        unionId: null,
        registrationId: null,
        price: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        availableMajorId: [
          {required: true, message: "可用的专业id,多个逗号分隔不能为空", trigger: "blur"}
        ],
      },
      checkopen: false,
      checkList: []

    }

  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询咨询师列表 */
    getList() {
      this.loading = true;
      listMember(this.queryParams).then(response => {
        this.memberList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    cancelcheckshow(){
      this.checkopen = false;
    },
    // 表单重置
    reset() {
      this.form = {
        memberId: null,
        guid: null,
        groupId: null,
        unitId: null,
        unitName: null,
        lastMajorId: null,
        availableMajorId: null,
        nickName: null,
        name: null,
        accountName: null,
        password: null,
        phone: null,
        phone1: null,
        phone2: null,
        briefIntroduction: null,
        level: null,
        sex: null,
        birthday: null,
        email: null,
        isMute: null,
        address: null,
        idCard: null,
        avatar: null,
        avatarId: null,
        avatarResId: null,
        isVip: null,
        expiryTime: null,
        vipType: null,
        status: "0",
        loginIp: null,
        loginDate: null,
        loginNum: null,
        videoNum: null,
        videoDuration: null,
        sort: null,
        starQuesIds: null,
        stepQuesIds: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        integral: null,
        signNum: null,
        province: null,
        city: null,
        intro: null,
        proQualifications: null,
        expertiseNotes: null,
        expertiseDemographics: null,
        expertiseTopics: null,
        expertiseGenres: null,
        education: null,
        profilePhotoUrl: null,
        certificateUrl: null,
        trainingExperience: null,
        trainingDuration: null,
        caseDuration: null,
        caseFiles: null,
        supervisionDuration: null,
        supervisionFiles: null,
        yearsOfExperience: null,
        deptId: null,
        openid: null,
        openId: null,
        unionId: null,
        registrationId: null,
        price: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.memberId)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加咨询师";
    },
    checkhandleUpdate(row) {
      this.checkopen = true;
      var params = {
        userId: row.memberId,
        status: "1"
      }
      alllistApplication(params).then(response => {
        this.checkList = response.data;
      })
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const memberId = row.memberId || this.ids
      getMember(memberId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改咨询师";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.memberId != null) {
            updateMember(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addMember(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const memberIds = row.memberId || this.ids;
      this.$modal.confirm('是否确认删除咨询师编号为"' + memberIds + '"的数据项？').then(function () {
        return delMember(memberIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('business/member/export', {
        ...this.queryParams
      }, `member_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
